package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingProject;
import com.zzyl.vo.NursingProjectVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface NursingProjectMapper {
    void insertNursingProject(NursingProject nursingProject);
    void deleteNursingProject(Long id);
    void updateNursingProject(NursingProject nursingProject);
    NursingProject selectNursingProjectById(Long id);
    NursingProject selectNursingProjectByName(String name);

   Page<NursingProjectVo> selectQuery(String name, Integer status);

   @Select("select count(*) from nursing_project where name=#{name}")
    Integer selectNursingProjectName(String name);

   @Select("select count(*) from nursing_project where name = #{name} and id != #{id}")
    Integer selectNursingProject(String name, Long id);
   @Update("update nursing_project set status =#{status} where id = #{id}")
    void updateStatus(Long id, Integer status);

   @Delete("delete from nursing_project where id = #{id}")
    void deleteById(Long id);




   @Select("select * from nursing_project")
   List<NursingProjectVo> selectAllNursingProject();




}